<template>
	<view class="wrap">
		<!-- 列表 -->
		<view class="school-body">
			<view class="school-list"  v-for="(item,index) in stuList" :key="item.id">
				<view class="school">
					<view class="school-l">
						<text class="school-name">学生：{{item.student_name}}</text>
					</view>
					<view class="school-r">
						{{item.insidebanji_id? '已分配':'未分配'}}
					</view>
				</view>
				<view class="can" >
					<view class="can-l" >
						<view class="can-li" >
							<view class="can-li-kuang">
							</view>
							<view class="can-li-title">
								年级:
							</view>
							<view class="can-li-price">
								{{item.nianji_name}}
							</view>
						</view>
						<view class="can-li" >
							<view class="can-li-kuang">
							</view>
							<view class="can-li-title">
								班级:
							</view>
							<view class="can-li-price">
								{{item.banji_name}}
							</view>
						</view>
					</view>
					<view class="can-r" :hidden="true">
						{{item.baoming_type == 2? '线下报名':'线上报名'}}
					</view>
				</view>
			</view>	

		</view>

		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				keyword:"", // 搜索关键字
				 schoolList:[], //已定价	   
				 allChecked:false,
				 selecValue: '',
				 tempoptions:[],
				 banji_id:0,
				 stuList:[],
            }	
		},
		onLoad(options) {
             
			 this.banji_id  = options.banji_id;
             this.stuListjk()
			// this.schoolListjk(2)
		},
		// computed: {
		// },
		methods: {

			//搜索
			search(){
				let current = this.current

			},
			//列表
			stuListjk(){
				let form = {
					"banji_id":this.banji_id
				};	
				this.$u.post('api/school/schoolstudentlist', form).then(res => {
					    this.stuList = res.data
				})
			},
			//模板列表
			feemobanList(){
				this.$u.post('api/school/feemobanList').then(res => {
					this.tempoptions = res
				})
			},
			tabchange(index){
				this.current = index;
			},
			selectOne(options){
				this.selecValue = options.label
				let feemoban_id = options.value
				
				let current = this.current
				let school_ids = [];
				if(current == 0){
					this.schoolList.forEach(val => {
						if(val.checked){
							school_ids.push(val.id);
						}
					})
				}else{
					this.schoolListwei.forEach(val => {
						if(val.checked){
							school_ids.push(val.id);
						}
					})
				}
				if(school_ids.length == 0){
					this.$u.toast("请选择学校")
					return;
				}
				this.$u.post('api/school/schoolbumenmobanupdate', {
					feemoban_id:feemoban_id,
					school_ids:school_ids
				}).then(res => {
						 this.$u.toast("成功")
						 this.schoolListjk(1)
						 this.schoolListjk(2)
				})
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	page{
		background-color: #F8F8F7;
	}
	
	.wrap {
		display: flex;
		flex-direction: column;
		height: calc(100vh - var(--window-top));
		width: 100%;
	
	}
	
	.search{
		margin-top: 20rpx;
		margin-bottom: 10rpx;
		background-color: #fff;
		height:200rpx;
		//overflow: hidden;
		//flex:1;
		.search-con{
			display: flex;
			justify-content: space-between;
			padding: 0 40rpx;
			align-items: center;
			.search-con-r{
				line-height: 48rpx;
				background: #2165F7;
				border-radius: 4rpx;
				text-align: center;
				color: #fff;
				font-size: 24rpx;
				width: 172rpx;
			}
		}
	}

   .school-body{
	   flex: 1;
	   overflow-y: scroll;
   }
	.school-list{
		background-color: #fff;
		margin-bottom: 20rpx;
		overflow: hidden;
		.school{
			display: flex;
			justify-content: space-between;
			margin: 0 40rpx;
			height: 90rpx;
			align-items: center;
			border-bottom: 2rpx solid #F1F1F1;
			.school-l{
				
				.school-title{
					font-size: 30rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
					padding-left:20rpx;
				}
			}
			.school-r{
				font-size: 28rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #D53030;
			}
		}
		.can{
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding-right:40rpx;
			padding-left: 88rpx;
			padding-top: 32rpx;
			padding-bottom: 5rpx;
			.can-li{
				display: flex;
				align-items: center;
				margin-bottom: 20rpx;
				.can-li-kuang{
					width: 12rpx;
					height: 12rpx;
					background: #2165F7;
					border-radius: 2rpx;
				}
				.can-li-title{
					font-size: 26rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #999999;
					padding: 0 9rpx 0 8rpx;
				}
				.can-li-price{
					font-size: 26rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #333333;
				}
			}
			.can-r{
				width: 140rpx;
				height: 50rpx;
				line-height: 50rpx;
				background: #E89C38;
				border-radius: 25rpx;
				color: #fff;
				font-size: 24rpx;
				font-family: PingFang SC;
				font-weight: 500;
				color: #F7F7F6;
				text-align: center;
			}
		}
	}
	
	// 模板选择
	.chooise{
		position: fixed;
		bottom: 20rpx;
		margin-left: -45%;
		left: 50%;
		width: 90%;
		height: 85rpx;
		background: #2165F7;
		border-radius: 20rpx;
	    color: #fff;
		display: flex;
		align-items: center;
		justify-content: center;
		
		.chooise-text{
			font-size: 30rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #FEFEFE;
			padding-right: 50rpx;
		}
	}

</style>
